RoadMap Class Reference

#include <Road.h>

List of all members.

Public Member Functions

 RoadMap (osg::ref_ptr< osg::Group > sgroot)
void addRoadMaptoRoot (osg::ref_ptr< osg::Group > sgroot, int flag)
void loadRoadScene (void)
osg::Vec3d getpt (const int np)
osg::Group * makedelaunay ()
void addNewRoad (RoadType type)
void addPoint (osg::Vec3 position)
void setActiveRoadIndex (int index)
int getActiveRoadIndex (void)
int getLastRoadIndex ()
void pinControl (osg::ref_ptr< osg::Group > sgroot)
void clearRoadMap ()
osg::ref_ptr< osg::Group > returnRoadNode ()
void addRoadNode (osg::ref_ptr< osg::Node > roadNodeToBeAdded)

Private Attributes

vector< Road * > roadMap
int currentRoadIndex
int lastRoadIndex
int pinFlag
osg::Vec3Array * points
osg::ref_ptr< osg::Group > roadRoot
osg::ref_ptr< osg::Group > dotRootNode
osg::ref_ptr< osg::Group > lineRootNode
osg::ref_ptr< osg::Group > linedotRoot
osg::ref_ptr< osg::Group > savedMap

Friends

class Road


Constructor & Destructor Documentation

RoadMap::RoadMap (  osg::ref_ptr< osg::Group >  sgroot  ) 
 

constructor takes the root as argument it adds 2 elements to this root. one is for the dots&lines (linedotRoot) the other is for the plane geometry which contains points that also includes roads.(roadRoot) initially the dots and lines are displayed.

Parameters:
sgroot is the root that the RoadMap will be inserted as a child


Member Function Documentation

void RoadMap::addNewRoad (  RoadType  type  ) 
 

add a new Road with the type specified, to the roadMap vector of the theRoadMap object this function also adds the new Road's dotRoot an dlineRoot to dotRootNode and lineRootNode respectively

Parameters:
type the type of the road to be added

void RoadMap::addPoint (  osg::Vec3  position  ) 
 

adds the specified point to the current Road Object

Parameters:
position is the point to be added

void RoadMap::addRoadMaptoRoot (  osg::ref_ptr< osg::Group >  sgroot,
int  flag
) 
 

adds the RoadMap to the root given as first argument. if the second argument is a 1 then the dots and line's geode is also added to the tree.

Parameters:
sgroot is the root that the RoadMap will be inserted as a child
flag determines whether the lines and dots will be added to the new root or not

void RoadMap::addRoadNode (  osg::ref_ptr< osg::Node >  roadNodeToBeAdded  ) 
 

needed for file operations the argument is made the new RoadMap

Parameters:
roadNodeToBeAdded is the new RoadMap node

void RoadMap::clearRoadMap (   ) 
 

clears all the roads from the map

int RoadMap::getActiveRoadIndex (  void   ) 
 

get active Road index

Returns:
the active Road index

int RoadMap::getLastRoadIndex (   ) 
 

Returns:
the lastly added Road index

osg::Vec3d RoadMap::getpt (  const int  np  ) 
 

fills the points array initally for a constructing the ground

void RoadMap::loadRoadScene (  void   ) 
 

this function should be called whenever the texturized environment is needed. it changes the children of the roadRoot with the new scene.

osg::Group* RoadMap::makedelaunay (   ) 
 

this function forms the actual texturized environment added to the scene. the lines of splines are turned into texturized road pieces and placed in the plane.

Returns:
the constructed plane with roads added as a Group

void RoadMap::pinControl (  osg::ref_ptr< osg::Group >  sgroot  ) 
 

this function removes the dots and lines in the environment from the tree according to the pinFlag's condition. if the flag is 0 meaning the dots and lines are not shown then it becomes one and the linedotRoot is added to the the tree else if the flag is 1, it is made 0 by this function and the linedotRoot is removed from the tree

Parameters:
sgroot is the root that the linedotRoot will be inserted as a child

osg::ref_ptr<osg::Group> RoadMap::returnRoadNode (   )  [inline]
 

returns the RoadMap as a Group

void RoadMap::setActiveRoadIndex (  int  index  ) 
 

Set active road index

Parameters:
index is the new active road index


Friends And Related Function Documentation

friend class Road [friend]
 


Member Data Documentation

int RoadMap::currentRoadIndex [private]
 

the active Road index

osg::ref_ptr<osg::Group> RoadMap::dotRootNode [private]
 

all Road's dotRoot groups are added to this group

int RoadMap::lastRoadIndex [private]
 

the lastly added Road index

osg::ref_ptr<osg::Group> RoadMap::linedotRoot [private]
 

dotRootNode and lineRootNode is added to this group and this group is added to the root provided in the initialization in the constructor of RoadMap

osg::ref_ptr<osg::Group> RoadMap::lineRootNode [private]
 

all Road's lineRoot groups are added to this group

int RoadMap::pinFlag [private]
 

the flag for control of the pins and lines

osg::Vec3Array* RoadMap::points [private]
 

the plane's points

vector<Road *> RoadMap::roadMap [private]
 

the added Road objects kept int this vector

osg::ref_ptr<osg::Group> RoadMap::roadRoot [private]
 

makedelaunay function adds the node containing the goede that involves points with texturing

osg::ref_ptr<osg::Group> RoadMap::savedMap [private]
 

holding the previously saved osg models. in each save operation the road structure is added to this root as a child.


The documentation for this class was generated from the following file:
Generated on Sun May 28 18:44:01 2006 by  doxygen 1.4.6-NO